<?php

class MainController extends Controller {
    /**
     * This is the default 'index' action that is invoked
     * when an action is not explicitly requested by users.
     */
    public function actionIndex() {
        $this->render('index');
    }

    /**
     * This is the action to handle external exceptions.
     */
    public function actionError() {
        if ($error = Yii::app() -> errorHandler -> error) {
            if (Yii::app() -> request -> isAjaxRequest)
                echo $error['message'];
            else
                $this -> render('error', $error);
        }
    }

    public function actions() {
        return array('getbyid' => 'application.controllers.actions.GetByIdAction');
    }

}
